# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
# Maintainer: Bradley J Chambers <brad.chambers@gmail.com>
pkgname=nitro
pkgver=2.7_beta8
_ver=${pkgver/_beta/dev-}
pkgrel=2
pkgdesc="Nitro NITF project"
url="https://github.com/hobu/nitro"
arch="all"
license="GPL-3.0-or-later"
makedepends="cmake linux-headers samurai"
subpackages="$pkgname-dev"
source="$pkgname-$_ver.tar.gz::https://github.com/hobu/$pkgname/archive/$_ver.tar.gz
	gettid.patch
	path-max.patch
	"
builddir="$srcdir/$pkgname-$_ver"
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DNITRO_PKG_SUBDIR=lib/pkgconfig
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5aba97037bfcb3543a881b74a1adb0dfbff689b4ce39bd674274470c9f5712af7f93f2528a5035154c0c4e79993c23a18084af7ff385f4ad1a714a92a51151f6  nitro-2.7dev-8.tar.gz
d1866140e2fb76ba48c6f63f966ee1079248bdef64dd218fa44c73126649168076cc9e2a36aecd58d2b29a3c326a89e6aa0a8376de89ff94144e49606c9e3d32  gettid.patch
58ad46ca4dde8511cda41af90d26c8898f84d509f6f9b31c2d17defc16a6d99aeba33d6c4c88d339ea39fe6598aa164c4ed46dfe009d06d46b3e11a5e13b78af  path-max.patch
"
